#apt install -y libssl-dev rapidjson-dev libboost-all-dev libre2-dev libb64-dev libnuma-dev patchelf
#pip3 install distro requests build
#pip3 install nvidia-pyindex tritonclient[all]

export TRITON_REPO_ORGANIZATION="https://gitee.com/121786404"
export TRITON_CONTAINER_VERSION=25.06

./build.py -v --no-container-build \
--build-dir=`pwd`/build \
--install-dir=/opt/tritonserver \
--enable-logging \
--enable-stats \
--enable-metrics \
--enable-cpu-metrics \
--enable-tracing \
--enable-gpu \
--endpoint=grpc \
--endpoint=http \
--repo-tag=common:r${TRITON_CONTAINER_VERSION} \
--repo-tag=core:r${TRITON_CONTAINER_VERSION} \
--repo-tag=backend:r${TRITON_CONTAINER_VERSION} \
--repo-tag=thirdparty:r${TRITON_CONTAINER_VERSION} \
--backend=tensorrt:r${TRITON_CONTAINER_VERSION} \
--backend=python:r${TRITON_CONTAINER_VERSION} \
--backend=vllm:r${TRITON_CONTAINER_VERSION} \
--backend=ensemble:r${TRITON_CONTAINER_VERSION} \
--cache=local:r${TRITON_CONTAINER_VERSION} \
--cache=redis:r${TRITON_CONTAINER_VERSION} \
--repoagents=checksum:r${TRITON_CONTAINER_VERSION} \
--upstream-container-version=${TRITON_CONTAINER_VERSION} \
--github-organization=${TRITON_REPO_ORGANIZATION} \
--version=${TRITON_CONTAINER_VERSION} \
--build-parallel=64








#--backend=onnxruntime:r${TRITON_CONTAINER_VERSION} \
#--release-version=25.05 \
# --enable-gpu-metrics \
# -DgRPC_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/grpc
# -Dc-ares_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/c-ares 
# -Dabsl_DIR:PATH=/usr/lib/x86_64-linux-gnu/cmake/absl 
# -DGTEST_ROOT:PATH=/usr/lib/x86_64-linux-gnu/cmake/GTest
# -Dnlohmann_json_DIR:PATH=/usr/share/cmake/nlohmann_json
# -Dlibevhtp_DIR:PATH=/usr/lib/cmake/libevhtp


# TRITON_ENABLE_METRICS_GPU    dcgm 关闭
# TRITON_CORE_HEADERS_ONLY

#libarchive-dev
